//
// Created by 袁绪龙 on 2024/5/31.
//

#ifndef ANGLELIB_TRIANGLEEGL_H
#define ANGLELIB_TRIANGLEEGL_H


#include <EGL/egl.h>
#include <GLES3/gl3.h>

#ifdef __cplusplus
extern "C" {
#endif

class Triangleegl {
public:
    /// 初始化EGL
    void initEGL(void *nativeWindow);

    /// 绘制三角形
    void renderTriangle();

    /// 销毁
    void cleanup();

private:
//    char *TAG = "Triangleegl_TAG";
    EGLDisplay m_display = EGL_NO_DISPLAY;
    EGLSurface m_surface;
    EGLContext m_context;
    EGLConfig m_config;

    GLuint m_program = 0;
    GLuint m_VertexShader;
    GLuint m_FragmentShader;

    GLuint m_window_width;
    GLuint m_window_height;
};

#ifdef __cplusplus
}
#endif


#endif //ANGLELIB_TRIANGLEEGL_H
